---
layout: "default"
title: "extend"
description: "Swift documentation for 'extend': Append elements from newElements to x.  Complexity:."
keywords: "extend,func,swift,documentation"
root: "/v1.2"
---

<div class="declaration" id="func-extend-c_-rangereplaceablecollectiontype-s_-collectiontype-where-c-generator-element-c-generator-element-inout_-c-newelements_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-extend-c_-rangereplaceablecollectiontype-s_-collectiontype-where-c-generator-element-c-generator-element-inout_-c-newelements_-s">func <wbr>extend&lt;C :<wbr> RangeReplaceableCollectionType, S : CollectionType where C.Generator.Element == C.Generator.Element&gt;(<wbr>inout:<wbr> C, newElements: S)</a>
        
<div class="comment collapse" id="comment-func-extend-c_-rangereplaceablecollectiontype-s_-collectiontype-where-c-generator-element-c-generator-element-inout_-c-newelements_-s"><div class="p">
    <p>Append elements from <code>newElements</code> to <code>x</code>.  Complexity:
O(N)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func extend&lt;C : RangeReplaceableCollectionType, S : CollectionType where C.Generator.Element == C.Generator.Element&gt;(inout x: C, newElements: S)</code>
    
    
</div></div>
</div>
